# $Id: PKGBUILD 65919 2012-02-22 13:38:32Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname='perl-sort-naturally'
pkgver=1.02
pkgrel=2
pkgdesc="sort lexically, but sort numeral parts numerically"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
url='http://search.cpan.org/dist/Sort-Naturally'
source=('http://search.cpan.org/CPAN/authors/id/S/SB/SBURKE/Sort-Naturally-1.02.tar.gz')
md5sums=('a173f3f8f519ebae6e5e578e843f6e1c')

build() {
  DIST_DIR="${srcdir}/Sort-Naturally-1.02"
  export PERL_AUTOINSTALL=--skipdeps PERL_MM_USE_DEFAULT=1 \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  { cd "$DIST_DIR" &&
    perl Makefile.PL &&
    make &&
    make test &&
    make install;
  };

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
